package com.example.boot.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/swagger")
@Api(tags = "swagger的控制器")
public class SwaggerController {

    @ResponseBody
    @GetMapping("/a")
    @RequestMapping(value = "/a",method = RequestMethod.GET)
    @ApiOperation(value = "a方法")
    @ApiImplicitParam(name = "name", value = "用户名称", required = true, paramType = "query")
    public String a(@ApiParam() @RequestParam("name") String name) {

        return name;
    }

    @ResponseBody
    @GetMapping("/b")
    @ApiOperation("b方法")
    public String b() {
        return "success";
    }

}
